package com.xt.LibaryDeskManager.dao;

import com.xt.LibaryDeskManager.dto.SeatDto;
import com.xt.LibaryDeskManager.vo.SeatVo;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 童归权
 * @version 1.0 2021/2/7
 */
@Repository
public interface SeatMapper {
    /**
     * 获得椅子数量
     * @return
     * @throws Exception
     */
    int getCount()throws Exception;

    /**
     * 获得所有座位信息
     * @return
     * @throws Exception
     */
    List<SeatDto> selectAll()throws Exception;

    /**
     * 获得所有座位信息
     * @return
     * @throws Exception
     */
    List<SeatDto> selectLike(String seatNo)throws Exception;
    /**
     * 获得指定教师所管理的座位信息
     * @return
     * @throws Exception
     */
    List<SeatDto> selectAllByTeacher(Integer teacherNo,String seatNo)throws Exception;
    /**
     * 更新座位信息
     * @param seatVo
     * @return
     * @throws Exception
     */
    int updateSeat(SeatVo seatVo) throws Exception;

    /**
     * 查找当前房间最后一个座位编号
     * @param seatNo
     * @return
     * @throws Exception
     */
    SeatDto getAvailableSeatNumber(String seatNo) throws Exception;

    /**
     * 添加座位信息
     * @param seatVo
     * @return
     * @throws Exception
     */
    int addSeat(SeatVo seatVo) throws Exception;

    /**
     * 删除座位信息
     * @param seatNo
     * @return
     * @throws Exception
     */
    int deleteSeat(String seatNo) throws Exception;

    /**
     * 更新座位状态信息
     * @param seatNo
     * @param i
     * @return
     * @throws Exception
     */
    int updateSeatStatue(String seatNo, int i)throws Exception;

    /**
     * 根据座位号查找座位
     * @param seatNo
     * @return
     * @throws Exception
     */
    SeatDto getSeatBySeatNo(String seatNo)throws Exception;

    /**
     * 将预约状态清0,添加当天状态
     * @throws Exception
     */
    int updateSeat1()throws Exception;
}
